<%- include('../includes/head.ejs') %>
<link rel="stylesheet" href="/css/orders.css">
</head>

<body>
    <%- include('../includes/navigation.ejs') %>
    <main>
        <% if(orders.length > 0) { %>
            <ul class="orders">
                <% orders.forEach(order => { %>
                    <li class="orders__item">
                        Order - # <%= order._id %>
                        <ul class="orders__products">
                            <% order.products.forEach(product => { %>
                                <li class="orders__products-item">
                                    <%= product.title %> (<%= product.quantity %>)
                                </li>
                            <% }) %>
                        </ul>
                    </li>
                <% }); %>
            </ul>
        <% } else { %>
            <h1>Nothing there!</h1>
        <% } %>
    </main>

<%- include('../includes/end.ejs') %>